Repository navigation
Clarify package token value editing - #564
Conversation
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR renames token restoration from ChangesPackage invocation token reinstate flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
🔎 Preview deployed: https://kody-pr-564.kentcdodds.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/worker/client/routes/account-package-invocation-tokens.tsx (1)
1270-1401: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDuplicate raw token input in the edit form — the old "Replace raw token" block was not removed.
The PR adds the new "Token value" section (Lines 1327-1401) but the prior "Replace raw token" field (Lines 1270-1325) is still present in the same
isEditingSelectedTokenform. The edit form now renders two identicalname="rawToken"password inputs, each with its own Generate/Copy buttons and helper text, both bound toeditorState.rawToken.This contradicts the PR intent (the new section was meant to replace the old layout) and produces a confusing UI with duplicated labels and controls. Remove the old block so only the "Token value" section remains.
🐛 Proposed fix: remove the old "Replace raw token" block
- <label mix={css(fieldCss)}> - <span mix={css(fieldLabelCss)}>Replace raw token</span> - <div - mix={css({ - display: 'grid', - gridTemplateColumns: 'minmax(0, 1fr) auto auto', - gap: spacing.sm, - [mq.mobile]: { - gridTemplateColumns: '1fr', - }, - })} - > - <input - name="rawToken" - type="password" - value={editorState.rawToken} - placeholder="Leave blank to keep the current token value" - autoComplete="off" - disabled={isMutating} - mix={[ - on('input', (event) => { - setEditorField( - 'rawToken', - event.currentTarget.value, - ) - handle.update() - }), - css(inputCss), - ]} - /> - <button - type="button" - disabled={isMutating} - mix={[ - on('click', generateEditorRawToken), - css(secondaryButtonCss), - ]} - > - Generate - </button> - <button - type="button" - disabled={isMutating || !editorState.rawToken} - mix={[ - on('click', () => void copyEditorRawToken()), - css(secondaryButtonCss), - ]} - > - Copy - </button> - </div> - <span mix={css(descriptionCss)}> - Paste or generate a new raw token only when rotating this - credential. Kody stores only its hash. - </span> - </label> - <div mix={css({ display: 'grid', gap: spacing.sm,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/worker/client/routes/account-package-invocation-tokens.tsx` around lines 1270 - 1401, The edit form currently renders two raw token inputs because the old “Replace raw token” block is still present alongside the new “Token value” section. In the `isEditingSelectedToken` form, remove the earlier `rawToken` label/input/button group and keep only the new `Token value` section so there is a single `editorState.rawToken` field with one set of Generate/Copy controls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/worker/client/routes/account-package-invocation-tokens.tsx`:
- Around line 1270-1401: The edit form currently renders two raw token inputs
because the old “Replace raw token” block is still present alongside the new
“Token value” section. In the `isEditingSelectedToken` form, remove the earlier
`rawToken` label/input/button group and keep only the new `Token value` section
so there is a single `editorState.rawToken` field with one set of Generate/Copy
controls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 73c35240-4084-40ff-878d-925849505104
📒 Files selected for processing (6)
docs/contributing/package-invocation-api.mddocs/guides/account-package-invocation-token-setup.mdpackages/worker/client/routes/account-package-invocation-tokens.tsxpackages/worker/src/app/handlers/account-package-invocation-tokens.node.test.tspackages/worker/src/app/handlers/account-package-invocation-tokens.tspackages/worker/src/package-invocations/repo.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
Token valuesection.New raw token valueand explain that saving it rotates the bearer value while the current value remains hidden.un-revoketoreinstatein UI, same-origin action code, tests, and docs.Token valuesection for rotations.Testing
npx vitest run packages/worker/src/app/handlers/account-package-invocation-tokens.node.test.tsnpm run typechecknpm run format:checknpm run lint(existing unrelated warnings only)Token value,New raw token value, Generate, and Copy, then permanently deleted the token.Summary by CodeRabbit
Documentation
Bug Fixes